<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('新增商户信息')"/>
    <th:block th:include="include :: datetimepicker-css"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-merchant-add">
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">商户名：</label>
            <div class="col-sm-8">
                <input name="merchantName" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">商户简称：</label>
            <div class="col-sm-8">
                <input name="merchantShortName" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">商户电话：</label>
            <div class="col-sm-8">
                <input name="merchantTelphone" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">法人姓名：</label>
            <div class="col-sm-8">
                <input name="artifName" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">法人身份证号：</label>
            <div class="col-sm-8">
                <input name="artifId" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">法人手机号：</label>
            <div class="col-sm-8">
                <input name="mobileNo" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">开户行许可证：</label>
            <div class="col-sm-8">
                <input name="bankLicense" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">开户行支行名称：</label>
            <div class="col-sm-8">
                <input name="bankBranchName" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">银行账号：</label>
            <div class="col-sm-8">
                <input name="account" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">商户地址：</label>
            <div class="col-sm-8">
                <input name="addr" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">联系人：</label>
            <div class="col-sm-8">
                <input name="linkMan" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">联系人电话：</label>
            <div class="col-sm-8">
                <input name="linkManTelphone" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">联系人身份证：</label>
            <div class="col-sm-8">
                <input name="linkManIdCard" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">联系人邮箱：</label>
            <div class="col-sm-8">
                <input name="linkEmail" class="form-control" type="text">
            </div>
        </div>
        <!--            <div class="form-group">    -->
        <!--                <label class="col-sm-3 control-label">交易笔数；结合tran_fre_type一起控制：</label>-->
        <!--                <div class="col-sm-8">-->
        <!--                    <input name="tranFre" class="form-control" type="text">-->
        <!--                </div>-->
        <!--            </div>-->
        <!--            <div class="form-group">    -->
        <!--                <label class="col-sm-3 control-label">最低限额；分：</label>-->
        <!--                <div class="col-sm-8">-->
        <!--                    <input name="minFee" class="form-control" type="text">-->
        <!--                </div>-->
        <!--            </div>-->
        <!--            <div class="form-group">    -->
        <!--                <label class="col-sm-3 control-label">最高限额；分：</label>-->
        <!--                <div class="col-sm-8">-->
        <!--                    <input name="maxFee" class="form-control" type="text">-->
        <!--                </div>-->
        <!--            </div>-->
        <!--            <div class="form-group">    -->
        <!--                <label class="col-sm-3 control-label">商户推广页面：</label>-->
        <!--                <div class="col-sm-8">-->
        <!--                    <input name="publicityPage" class="form-control" type="text">-->
        <!--                </div>-->
        <!--            </div>-->
        <div class="form-group">
            <label class="col-sm-3 control-label">商户备注：</label>
            <div class="col-sm-8">
                <input name="remark" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">营业执照号：</label>
            <div class="col-sm-8">
                <input name="businessLicense" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">入驻时间：</label>
            <div class="col-sm-8">
                <div class="input-group date">
                    <input name="addTime" class="form-control" placeholder="yyyy-MM-dd" type="text">
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">签名类型：</label>
            <div class="col-sm-8">
                <select name="merchantSignType" id="merchantSignType" class="form-control" required>
                    <option value="1">MD5</option>
                    <option value="2">RSA</option>
                </select>
            </div>
        </div>
        <div class="form-group md5Key">
            <label class="col-sm-3 control-label">商户MD5密钥：</label>
            <div class="col-sm-8">
                <input name="merchantMd5Key" class="form-control" type="text" placeholder="后台生成" disabled>
            </div>
        </div>
        <div class="form-group rsaPublickKey">
            <label class="col-sm-3 control-label">商户RSA交换公钥：</label>
            <div class="col-sm-8">
                <textarea name="merchantRsaPublickKey" class="form-control" placeholder="请填写商户提供的交换公钥"></textarea>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">启用状态：</label>
            <div class="col-sm-8">
                <select name="status" class="form-control" required>
                    <option value="1">启用</option>
                    <option value="2">暂停</option>
                </select>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: datetimepicker-js"/>
<script th:inline="javascript">
        var prefix = ctx + "mng/merchant"
        $("#form-merchant-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-merchant-add').serialize());
            }
        }

        $("input[name='addTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });


        $("#merchantSignType").change(function () {
            var selectedId = $("#merchantSignType option:selected").val();
            if (selectedId != 1) {
                $(".md5Key").hide()
                $(".rsaPublickKey").show()
            } else {
                $(".md5Key").show()
                $(".rsaPublickKey").hide()
            }
         });

        $(function () {
                $(".rsaPublickKey").hide()
        })

</script>
</body>
</html>